﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GameClient
{
    public partial class Connect : Form
    {
        private string m_sAddress;
        private string m_sLogin;
        private string m_sPassword;
        private string m_sPort;

        public string Address { get { return m_sAddress; } }
        public string Login { get { return m_sLogin; } }
        public string Password { get { return m_sPassword; } }
        public string Port { get { return m_sPort; } }

        public Connect()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0)
            {
                MessageBox.Show("Please Enter An Address");
                return;
            }
            if (textBox2.Text.Length == 0)
            {
                MessageBox.Show("Please Enter A Login");
                return;
            }
            if (textBox3.Text.Length == 0)
            {
                MessageBox.Show("Please Enter A Password");
                return;
            }
            if (textBox4.Text.Length == 0)
            {
                MessageBox.Show("Please Enter A Port (50000) Default");
                return;
            }

            m_sAddress = textBox1.Text;
            m_sLogin = textBox2.Text;
            m_sPassword = textBox3.Text;
            m_sPort = textBox4.Text;

            this.DialogResult = DialogResult.OK;

            this.Close();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            textBox1.Text = String.Empty;
            textBox2.Text = String.Empty;
            textBox3.Text = String.Empty;
            textBox4.Text = String.Empty;
        }
    }
}
